package com.test;

import java.util.*;

import com.test.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/getUsers")
    public List<User> getUsers(){
        return userService.findAll();
    }


    @RequestMapping("/api/hello")
    public Object hello(String name) {
        User user = new User();
        user.setId("@324");
        user.setCreateTime(new Date());
        Map<String, Object> map = new HashMap<>(3);
        map.put("作者信息", user);
        map.put("博客地址", "http://blog.itcodai.com");
        map.put("CSDN地址", null);
        ArrayList<String> strings = new ArrayList<>();
        map.put("strings", strings);
        map.put("粉丝数量", 1);
        return map;

    }

}